package cn.wn.service.impl;

import cn.wn.mapper.RoleMapper;
import cn.wn.pojo.Role;
import cn.wn.service.RoleService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleMapper roleMapper;
    @Override
    public PageInfo<Role> findByPage(Integer pageNum, Integer pageSize) {
        // PageHelper分页支持
        PageHelper.startPage(pageNum,pageSize);
        List<Role> list = roleMapper.findAll();
        return new PageInfo<>(list);
    }
}
